cmake_minimum_required(VERSION 3.18)

project(QtTool)

# list(APPEND CMAKE_PREFIX_PATH /home/wd/data/thirdparty/QtSDK)

# set(CMAKE_PREFIX_PATH $ENV{QTDIR})

file(GLOB_RECURSE QTSRC *.cpp *.hpp *.c)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(APPEND CMAKE_MODULE_PATH "/home/wd/data/thirdparty/Qt6SDK/lib/cmake/Qt6")
# set(Qt_DIR "/home/wd/data/thirdparty/Qt6SDK/lib/cmake/Qt6")
# set(QT_QPA_PLATFORM_PLUGIN_PATH "/home/wd/data/thirdparty/Qt6SDK/plugins/platforms")
# find_package(Qt5 COMPONENTS Core Gui REQUIRED)
find_package(Qt6 COMPONENTS Widgets REQUIRED)
set(QT_INCLUDE $ENV{QTDIR}/include)
# include_directories(${QT_INCLUDE})
# include_directories(/home/wd/data/thirdparty/QtSDK/include)
message(STATUS "+++++++++++++${QT_INCLUDE}")

if(Qt6_FOUND)
    message(STATUS "+++++++++++++++++++++++++++++++")
endif(Qt6_FOUND)

# find_package(Qt5 COMPONENTS  REQUIRED)

# include_directories()

add_executable(QtTool ${QTSRC})
target_link_libraries(QtTool Qt::Widgets)